var ViewService = Class.extend({

	SERVICE_URL : 'api/view',

	get : function(successcb, errorcb) {
		httpPromise = this.$http.get(this.SERVICE_URL);
		return this._thenFactoryMethod(httpPromise, successcb, errorcb)
	},
	_thenFactoryMethod : function(httpPromise, successcb, errorcb) {
		var scb = successcb || angular.noop;
		var ecb = errorcb || angular.noop;

		return httpPromise.then(function(response) {
			var result = response.data;
			scb(result, response.status, response.headers, response.config);
			return response.data;
		}, function(response) {
			//alert('errr');
			ecb(undefined, response.status, response.headers, response.config);
			return undefined;
		});
	}
});